home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / exampleapps / email / Application.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.8 KB  |  66 lines

  1. <!--- First, test for locahost and abort to message window if not --->
  2.  
  3. <CFParam Name = "CGI.REMOTE_ADDR" default="">
  4.  
  5. <CFIF CGI.REMOTE_ADDR is '' OR NOT (CGI.REMOTE_ADDR IS 'localhost' OR CGI.REMOTE_ADDR IS '127.0.0.1')>
  6.  
  7.  
  8.     <CFINCLUDE template="/cfdocs/sorry.htm">
  9.  
  10.     <CFABORT>
  11.  
  12. </CFIF>
  13.  
  14.  
  15. <!--- application file, exampleapp\email --->
  16. <!--- this file restricts the use of the email directory to the 127.0.0.1 or localhost address --->
  17.  
  18. <CFAPPLICATION NAME="crazycab" SESSIONMANAGEMENT="Yes" SETCLIENTCOOKIES="Yes" SESSIONTIMEOUT="#CreateTimeSpan(0,1,30,0)#">
  19.  
  20. <!--- specify location, interval, and switch for redirection (defaults to 1)--->
  21. <!--- if redirection is desired, set redto 1 --->
  22. <CFPARAM name="variables.new_location" default="http://www.allaire.com/documents/">
  23. <CFPARAM name="variables.new_interval" default="10">
  24. <CFPARAM name="variables.redirect_switch" default="0">
  25.  
  26. <!--- restrict IP here --->
  27. <CFIF cgi.REMOTE_ADDR NEQ "127.0.0.1" AND 0>
  28.  
  29.  
  30. <CFINCLUDE template="_header.cfm">
  31.  
  32. <CFIF redirect_switch eq 1>
  33.     <CFOUTPUT>
  34.         <CFHTMLHEAD text="<META Http-equiv='Refresh' Content='#new_interval#; url=#new_location#'>">        
  35.     </CFOUTPUT>
  36. </CFIF>
  37.  
  38.  
  39. <h3>
  40. <P>Please view your copy of ColdFusion locally<BR>
  41.      to use the CrazyCab Application.
  42.  
  43. <CFIF redirect_switch eq 1>
  44.     <CFOUTPUT>
  45.     <P>Be patient; you will be redirected to <BR>
  46.     #new_location# in #new_interval# seconds.
  47.     </CFOUTPUT>
  48. </CFIF>
  49. </h3>
  50.  
  51. <CFINCLUDE template="_footer.cfm">
  52.  
  53.  
  54. <CFABORT>
  55. </CFIF>
  56.  
  57.  
  58. <!--- Make sure we're logged in correctly --->
  59. <CFIF GetFileFromPath(GetTemplatePath()) NEQ "login.cfm" AND GetFileFromPath(GetTemplatePath()) NEQ "auth.cfm">
  60.     <CFIF NOT IsDefined("Session.POPserver")>
  61.         <CFLOCATION URL="login.cfm" ADDTOKEN="NO">
  62.     <CFELSEIF Session.POPserver IS "">
  63.         <CFLOCATION URL="login.cfm" ADDTOKEN="NO">
  64.     </CFIF>
  65. </CFIF>
  66.